home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1865 / 1865.xpi / chrome / adblockplus.jar / content / ui / findbar.js < prev    next >
Text File  |  2010-01-07  |  2KB  |  80 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is Adblock Plus.
  15.  *
  16.  * The Initial Developer of the Original Code is
  17.  * Wladimir Palant.
  18.  * Portions created by the Initial Developer are Copyright (C) 2006-2009
  19.  * the Initial Developer. All Rights Reserved.
  20.  *
  21.  * Contributor(s):
  22.  *
  23.  * ***** END LICENSE BLOCK ***** */
  24.  
  25. /**
  26.  * Fake browser implementation to make findbar widget happy - searches in
  27.  * the filter list.
  28.  */
  29. let fastFindBrowser =
  30. {
  31.     fastFind: {
  32.         searchString: null,
  33.         foundLink: null,
  34.         foundEditable: null,
  35.         caseSensitive: false,
  36.         get currentWindow() { return fastFindBrowser.contentWindow; },
  37.  
  38.         find: function(searchString, linksOnly)
  39.         {
  40.             this.searchString = searchString;
  41.             return treeView.find(this.searchString, 0, false, this.caseSensitive);
  42.         },
  43.  
  44.         findAgain: function(findBackwards, linksOnly)
  45.         {
  46.             return treeView.find(this.searchString, findBackwards ? -1 : 1, false, this.caseSensitive);
  47.         },
  48.  
  49.         // Irrelevant for us
  50.         init: function() {},
  51.         setDocShell: function() {},
  52.         setSelectionModeAndRepaint: function() {},
  53.         collapseSelection: function() {}
  54.     },
  55.     currentURI: abp.makeURL("http://example.com/"),
  56.     contentWindow: {
  57.         focus: function()
  58.         {
  59.             E("list").focus();
  60.         },
  61.         scrollByLines: function(num)
  62.         {
  63.             E("list").boxObject.scrollByLines(num);
  64.         },
  65.         scrollByPages: function(num)
  66.         {
  67.             E("list").boxObject.scrollByPages(num);
  68.         },
  69.     },
  70.  
  71.     addEventListener: function(event, handler, capture)
  72.     {
  73.         E("list").addEventListener(event, handler, capture);
  74.     },
  75.     removeEventListener: function(event, handler, capture)
  76.     {
  77.         E("list").addEventListener(event, handler, capture);
  78.     },
  79. }
  80.